home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / SAT 2.4.0 / SAT / Add-ons / Sprite behavior / SATGridToolbox.h < prev    next >
Encoding:
Text File  |  1997-03-01  |  1.2 KB  |  30 lines  |  [TEXT/KAHL]

  1. /*SATGridToolbox*/
  2. /**/
  3. /* Routines for SAT-based games with a game world defined by a grid.*/
  4. /* Note that this is the "Oxyd"-style world, where movement isn't contrained to the grid,*/
  5. /* but obstacles etc are defined by it. It is NOT ment for strict grid movement, as in PacMan!*/
  6. /**/
  7. /* Limitations and assumptions:*/
  8. /* • Your grid is defined in the unit SATGridStubs.*/
  9. /* • All free space grid values are smaller than the blocked ones. (Specified by kFreeSpace.) */
  10. /* • Sprites should not be bigger (wider/higher) than the grid spaces. (Sprites only check with the*/
  11. /* corners of the hotRects, which mens that a small grid obstacle could pass right through it!)*/
  12.  
  13. // You need to make a copy of SATGridStubs.p, edit it as appropriate and include in
  14. // the same project. Also, SATGridToolbox.p needs to be included, as source-code, not
  15. // as a library.
  16.  
  17. #include <SAT.h>
  18. #include <SATToolbox.h>
  19.  
  20. // If you change GridSpaceType in SATGridStubs, change this typedef too!
  21. typedef short GridSpaceType;
  22.  
  23. pascal void MoveSpriteInGrid(FixSpritePtr theSprite);
  24. pascal GridSpaceType Pt2GridValue(Point p);
  25. pascal void LoadGrid(short resNum);
  26. pascal void DrawAllTiles();
  27. pascal Boolean PtInGrid(Point p);
  28. pascal void GridTest(FixSpritePtr theSprite);
  29.  
  30.